When using an old version of clang-format, be more explicit in term of version
Categories
(Developer Infrastructure :: Source Code Analysis, enhancement)
Tracking
(firefox83 fixed)
Tracking | Status | |
---|---|---|
firefox83 | --- | fixed |
People
(Reporter: Sylvestre, Assigned: harnaman24, Mentored)
References
(Blocks 2 open bugs)
Details
(Keywords: good-first-bug, Whiteboard: [lang=python])
Attachments
(1 file, 1 obsolete file)
Currently, we have:
You're using an old version of clang-format binary. Please update to a more recent one by running: './mach bootstrap'
would be better to have
You're using an old version (8.0.1) of clang-format binary. Please update to a more recent (at least > 9.0.1 one by running: './mach bootstrap'
The code is declared twice:
https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/code-analysis/mach_commands.py#212
and
https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/code-analysis/mach_commands.py#1550
we should refactor that to have it once
Expected version is found here:
https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/code-analysis/mach_commands.py#905
and the detected:
https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/code-analysis/mach_commands.py#918
Happy to mentor someone!
Comment 1•6 years ago
|
||
Hi Sylvestre,
I would like to work on this issue.
Kind Regards
Sonia
Reporter | ||
Comment 2•6 years ago
|
||
Sure, just submit a patch :)
Updated•6 years ago
|
Reporter | ||
Comment 3•6 years ago
|
||
Sonia, not sure why you need-info me ?!
I don't see any patch here :)
Comment 4•6 years ago
|
||
Hello Sylvestre,
Is it possible I work on this issue? I am a new contributor and came by this issue. I like to ask that are patches equivalent to commits to the version control server which in this case is Mercurial? In addition, is it better to discuss on this thread or on IRC like mibbit?
Sincerely,
Peter Chou
Comment 5•6 years ago
|
||
Hi Peter,
I am already working on this patch. You can pick any other issue from the bug list. And, #media
is the IRC channel where you can ask your questions. It depends on the time-zone of yours and mentor if they are being active around that time or not.
Welcome to the Mozilla Community :)
Kind Regards
Sonia
Comment 6•6 years ago
|
||
Alright. Thanks for informing me Sonia.
Reporter | ||
Comment 7•6 years ago
|
||
Sonia, please let me know when the patch is ready.
thanks
Comment 8•6 years ago
•
|
||
Expected version is found here:
https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/code-analysis/mach_commands.py#905
and the detected:
https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/code-analysis/mach_commands.py#918
I didn't get about the version part. This is little unclear to me. Can you please explain little bit?
Reporter | ||
Comment 9•6 years ago
|
||
Could you explain what is unclear? Thanks
And,
#media
is the IRC channel where you can ask your questions. It depends on the time-zone of yours and mentor if they are being active around that time or not.
Note that #media is primarily concerned with Mozilla's media stack and other channels may be able to better answer questions that aren't media related. There's currently an outreachy project proposed around media, which makes it a good port of first call if you're interested in that project, but that for bugs like this one other channels (like #build) may be able to offer more specific help.
I didn't get about the version part. This is little unclear to me. Can you please explain little bit?
I believe these lines get the desired version of the clang tidy that we want to use, based on configuration files.
These lines then run the installed version of clang-format (which should have the same version as clang-tidy, as they're installed as a pair) and compare the version string it outputs to the one we expect. If it matches we return true, if it doesn't match, or if we can't run clang-format then we return false.
Does that help?
Comment 11•6 years ago
|
||
To improve the version comparison, it is required to be more explicit while using old-version of clang-format.
Reporter | ||
Comment 12•6 years ago
|
||
Sonia, are you still working on this or should I unassign this bug?
Thanks
Comment 13•5 years ago
|
||
Hi Sylvestre,
Am sorry for the delay. If it's urgent you can unassign the bug, no worries :)
Reporter | ||
Comment 14•5 years ago
|
||
it isn't urgent but if you don't have time, we can find someone else :)
Updated•5 years ago
|
Reporter | ||
Comment 15•5 years ago
|
||
Unassigned as no progress for the last 5 months
Updated•5 years ago
|
Assignee | ||
Comment 16•5 years ago
|
||
Hi Sylvestre
I am a new contributor. I would like to work on this issue.
Reporter | ||
Comment 17•5 years ago
|
||
sure, please go ahead and try to submit a patch :)
Reporter | ||
Comment 18•5 years ago
|
||
Note: We have a tutorial here:
https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
Assignee | ||
Comment 19•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 20•5 years ago
|
||
The code is declared twice:
https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/code-analysis/mach_commands.py#212
and
https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/code-analysis/mach_commands.py#1550
we should refactor that to have it once
I'm not sure on how to achieve this
Updated•5 years ago
|
Comment 21•5 years ago
|
||
Comment 22•5 years ago
|
||
bugherder |
![]() |
||
Comment 23•5 years ago
|
||
Today with clang trunk I got ERROR: You're using an old or incorrect version (clang-format version 12.0.0) of clang-format binary. Please update to a more recent one (at least > 11.0.0) by running: './mach bootstrap'
which is kind of awkward. Should newer versions be accepted? Or should the messaging change?
Reporter | ||
Comment 24•5 years ago
|
||
This is why we wrote "or incorrect" but, for sure, the "more recent one" is misleading.
The issue with having different versions of clang-format is that it generates different output.
If you want to play with 12, update package_version in tools/clang-tidy/config.yaml
We could update the message if you want :)
Updated•3 years ago
|
Description
•